package nl.pcnerd.roelve.javagame.map;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;

import javax.imageio.ImageIO;

public class TileSet {

	private BufferedImage tileSet;
	private HashMap<String, Tile> tiles;
	private File tileInfo;

	/**
	 * Constructor for TileSet. Creates a {@link TileSet} from an incomplete
	 * filename. Only the name of the tileSet should be specified, the reader
	 * will automatically create the tileSet image and the tileSet information
	 * file, which stores the name of the tile and the frames of the tile. For
	 * good measures, animated tiles should be placed horizontally along the
	 * tileset.
	 * 
	 * @param setName
	 *            The name of the tileset
	 */
	public TileSet(String setName) {
		tiles = new HashMap<String, Tile>();
		tileSet = null;
		// TODO, catch read exceptions
		tileInfo = new File("res/tilesets/" + setName + ".tifo");
		try {
			tileSet = ImageIO
					.read(new File("res/tilesets/" + setName + ".png"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/**
	 * This will read the information file and generate tiles accordingly
	 */
	private void readInfo() {

	}

}
